#include "IMDBFileHeader.h"


IMDBFileHeader::IMDBFileHeader(istream& source)
{
   string dummy;
   source >> dummy;
   source >> hex >> crc; 
   source >> dummy >> originalFileName >> dummy;
   getline(source, dateCreated).ignore(1);
   getline(source, copyright);
   SkipRestOfHeader(source);
}

/*
CRC: 0x45CCCA37  File: actresses.list  Date: Thu Mar 25 17:00:00 2010

Copyright 1993-2007 The Internet Movie Database, Inc.  All rights reserved.
*/


IMDBFileHeader::~IMDBFileHeader(void)
{
}


void IMDBFileHeader::SkipRestOfHeader(istream& source) const
{
   string line;
   string endOfHeaderLine = "----			------";
   while(getline(source, line))
   {
      if(line.find(endOfHeaderLine) != string::npos)
         break;
   }
}
